
<#include "/basicdata/common/scripts.html">
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=11,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">
    <link rel="icon shortcut bookmark" type="image/png" href="${static}/img/login/gipson-logo.png">
    <title>捷布森权限管理系统</title>
    <style>
        /* 滚动条样式：(有浏览器兼容问题) */
        /*滚动条 start*/
        ::-webkit-scrollbar {
            width: 7px;
            height: 7px;
            background-color: #757575;
        }
        /*定义滚动条轨道 内阴影+圆角*/
        ::-webkit-scrollbar-track {
            -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
            background: #fff ;
        }
        /*定义滑块 内阴影+圆角*/
        ::-webkit-scrollbar-thumb {
            border-radius: 3px;
            -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3);
            background-color:#757575;
        }

        h2{
            margin-top: 20px;
            margin-bottom: 10px;
        }

    </style>


    <script type="text/javascript">
        function showLoading(msg) {
            return layer.msg(msg||'加载中...', {
                icon : 16,
                shade : [ 0.5, 'black' ],
                scrollbar : false/* ,offset: '0px' */,
                time : 100000
            });
        }
        function closeLoading(index) {
            layer.close(index);
        }
        function showTip() {
            layer.msg('加载完成！', {
                time : 500
                /* ,offset: '10px' */});
        }
        $.fn.selectpicker.Constructor.DEFAULTS.size=12;

        (function(window){
            sys.getNoSyncData("showset/getShowSetInfo",{},function(data){
                window._showDataInfo = data;
            })
        })(window);

        if(console.table === undefined){
            console.table = console.log;
        }

        PROCESS_CONFIG.isGroupCompany = "true";
    </script>
    <style>
        html, body {
            background: #000;
            margin: 0;
            padding: 0;
        }

        body {
            background: url('../static/img/login/loginbg2.jpg');
            background-size: 100% 100%;
            background-repeat: no-repeat;
            text-align: center;
            min-height: 730px;
            min-width: 1330px;
            overflow: auto;
        }

        .fh-login{
            background: url('../static/img/login/fh-login.png') no-repeat;
            width:860px;
            height:465px;
            position:fixed;
            top:50%;
            left:50%;
            margin-top:-250px;
            margin-left:-440px;
        }
        .fh-login .fh-login-left{
            float:left;
            width:50%;
        }
        .fh-login .fh-login-left img{
            margin-top:50px;
        }
        .fh-login .fh-login-left h2{
            padding: 30px 50px;
            color: #FFF;
            font-size: 35px;
            line-height: 54px;
            font-weight: 600;
        }
        .fh-login .fh-login-left .fh-log{
            color:#fff;
            font-size:44px;
            font-weight:900;
        }
        .fh-login .fh-login-right{
            float:right;
            width:50%;
        }
        .fh-login-right .login-title{
            font-size:24px;
            color:#333;
            padding:15px 0px;
            border-bottom:1px solid #ccc;
        }
        .fh-login-right .group{
            display:inline-block;
            border:1px solid #ccc;
            margin:10px 0px;
            width:80%;
            border-radius:5px;
        }
        .fh-login-right .group>img{
            margin-left:2%;
        }
        .fh-login-right .group input{
            border:none!important;
            outline:none!important;
            background-color:#fff!important;
            height:42px!important;
            width:87%!important;
            padding:0px 10px!important;
        }
        .glyphicon-record{
            color:#52A6D4;
        }
        .glyphicon-records{
            border:2px solid #52A6D4;
            border-radius:50%;
            width:14px;
            height:14px;
        }
        .fh-log span{
            margin-right:-8px;
        }
        .login-bottom-title{
            position: absolute;
            bottom: -160px;
            left: -400px;
            color: white;
            width: 100%;
            text-align: center;
            width: 800px;
        }
    </style>
</head>

<body>
<div class="fh-login">
    <div class="fh-login-left">
        <img class="logo-top" src="${static}/img/login/gipson-logo.png" style="height:130px;width:auto;">
        <h2 class="logo-center">捷布森权限管理系统</h2>
        <h2 class="logo-center" style="padding:0px 0px;">GIPSON AMC</h2>
    <!--<img class="logo-bottom" src="http://demo.windasoft.com:8080/windaedm/img/login/gif.gif" style="margin-top:10px;">-->
    </div>
    <div class="fh-login-right" style="position: relative;">
        <div class="login-title">欢迎使用</div>
        <form class="form-horizontal" autocomplete=off style="padding-top:30px;">
            <div class="group">
                <img src="${static}/img/login/fh-user.png" style="width:30px">
                <input type="text" class="input-control" id="username"  autocomplete="off" placeholder="用户名">
            </div><br>
            <div class="group">
                <img src="${static}/img/login/suo.png" style="width:30px">
                <input type="password" class="input-control" id="password"  autocomplete="off" placeholder="密　码">
            </div><br>
            <div class="group" style="border:none;padding:30px 0px;">
                <div style="float:left;" class="fh-group-left">
                    <span  id="checkbox1" class="glyphicon glyphicon-records"></span>
                    <span class="text">记住密码</span>
                    <input type="hidden" id="rememberMe" name="rememberMe">
                </div>

            </div>
            <div class="group">
                <button style="width:100%;border:none;background:#52A6D4;color:#fff;" type="button" class="btn btn-default" onclick="login()">登录</button>
            </div>
        </form>
<!--
        <div class="login-bottom-title">请使用IE9及以上版本，EDGE、360极速、搜狗、腾讯、UC、遨游、谷歌、火狐、OPERA浏览器登录</div>
-->
    </div>
</div>
</body>

<script type="text/javascript" src="http://demo.windasoft.com:8080/windaedm/plugin/crypto/crypto-js.js"></script>
<script type="text/javascript" src="http://demo.windasoft.com:8080/windaedm/plugin/crypto/aes.js"></script>
<script type="text/javascript" src="http://demo.windasoft.com:8080/windaedm//plugin/crypto/md5.js"></script>
<script type="text/javascript" src="http://demo.windasoft.com:8080/windaedm/js/authentication.js"></script>
<script type="text/javascript">

    var sys_name = "捷布森管理系统";
    if(sys_name != "捷布森管理系统"){
        $(".logo-bottom").hide();
        $(".logo-center").css({"margin-top":"25px"});
        $(".logo-top").css({"margin-top":"80px"});
    }

    $(function(){
        var h=$(window).height();
        $("body").height(h);
    });
    var timer = setInterval(function(){
        doItPerSecond();
    },300)
    var num=0;
    function doItPerSecond() {
        $(".fh-login-left .fh-log").children("span").css("color","#fff");
        $(".fh-login-left .fh-log").children("span").eq(num).css("color","yellow");
        num++;
        console.log(num);
        if(num>8){
            $(".fh-login-left .fh-log").children("span").css("color","#fff");
            window.clearInterval(timer);
        }


    }
    $(function(){
        $(".fh-group-left").children("span:first").click(function(){
            if($(this).is('.glyphicon-records')){
                $(this).removeClass('glyphicon-records');
                $(this).addClass("glyphicon-record");
            }
            else{
                $(this).addClass("glyphicon-records");
                $(this).removeClass('glyphicon-record');
            }
        })
    })


    //登录
    function login() {

        RemeberUser();//登录之前记住用户名和密码

        var param = {
            "username" : $("#username").val(),
            "password" : $("#password").val(),
            "rememberMe" :$("#rememberMe").val()
        }

        doLogin(param);

       /* var superIndex = param.account.indexOf("@super-");
        if(superIndex == 0){
            //直接md5
            param.account = param.account.substring("@super-".length);
            param.password = CryptoJS.MD5(param.password).toString();
            $.post("manage/loginRequest", {account: param.account}, function(data){
                if(data.code != 0){
                    sys.msg(data);
                    return;
                }
                doLogin(param);
            });
        }else {
            var auth = new Authentication();
            $.post("manage/loginRequest", {account: param.account}, function(data){
                if(data.code != 0){
                    sys.msg(data);
                    return;
                }
                doLogin(auth.getLoginParam(data, param.account, param.password));
            });
        }*/

    }

    function doLogin(params){

        $.ajax({
            url : "doLogin",
            type : "POST",
            datatype : "json",
            data :params,
            success : function(data, stats) {
                if (data.success) {
                    sys.topmsg(data.message);
                    location = "/sys/index";
                } else {
                    sys.topmsg(data.message);
                }
            },
            error : function(data) {
                sys.topmsg("网络异常,登录失败！");
            }
        });
    }

    //焦点在input回车提交
    $('input').bind('keypress', function(event) {
        if (!event)
            event = window.event;
        if ((event.keyCode || event.which) == 13) {
            login();
        }
    });

    $(document).ready(function() {
        //原起点
        if ($.cookie("rmbUser") == "true") {
            $("#checkbox1").trigger("click");
            $("#username").val($.cookie("username"));
            $("#password").val($.cookie("password"));
        }

        //避免加载的时候不触发改大小
        var height = $(document.body).height();
        if (height < 800) {
            $(".input-control").css({
                "height" : "38px",
                "line-height" : "38px"
            });
            $(".icon-user").css({
                "height" : "38px",
                "width" : "38px"
            });
            $(".icon-lock").css({
                "height" : "38px",
                "width" : "38px"
            });
            $(".form-horizontal .btn").css({
                "height" : "38px"
            });
        } else {
            $(".input-control").css({
                "height" : "50px",
                "line-height" : "50px"
            });
            $(".icon-user").css({
                "height" : "50px",
                "width" : "50px"
            });
            $(".icon-lock").css({
                "height" : "50px",
                "width" : "50px"
            });
            $(".form-horizontal .btn").css({
                "height" : "50px"
            });
        }
    });

    //记住用户名密码
    function RemeberUser() {
        if ($("#checkbox1").is('.glyphicon-record')) {
            /*var str_username = $("#username").val();
            var str_password = $("#password").val();

            $.removeCookie("rmbUser",{ path: '/'});
            $.removeCookie("username",{ path: '/'});
            $.removeCookie("password",{ path: '/'});

            $.cookie("rmbUser", "true", {expires : 7});
            $.cookie("username", str_username, {expires : 7});
            $.cookie("password", str_password, {expires : 7});*/

            $("#rememberMe").val("1");

        } else {
            /*$.removeCookie("rmbUser",{ path: '/'});
            $.removeCookie("username",{ path: '/'});
            $.removeCookie("password",{ path: '/'});*/
            $("#rememberMe").val("0");
        }
    };
</script>
</html>
